<?php
// **************************************************************
//  Copyright 2007 AMC
//  Glenview, Illinois
//
//  File:      member_edit.php
//  Author:    Mickey Freeman (mfreeman@connect2amc.com)
//  Function:  Page for registering a member
//
//  Created: 08/16/07
//  Version: 1.0
//
//  Modified:
// **************************************************************
require_once 'init.php';
$msg           = $_REQUEST[msg];
$obj_page      = new pages();


// pulling the page task
$task             = $_REQUEST['task'];
$obj              = new ws_secure_user();
$obj->load($usr_id);


if (!$usr_id){
    $obj->usr_active = 1;
}
switch ($task) {

case 'display':
	//validate.html
	$contentfirst       = $obj_page->curl_data($_REQUEST['first_url']);
    $contentsecond      = $obj_page->curl_data($_REQUEST['second_url']);
    $f1                 = explode(chr(10),$contentfirst);

//   print_r($contentfirst);
    $f2                 = explode(chr(10),$contentsecond);
//  $f1=Array(  "<html>",
//                "<head><title>Text</title></head>",
//                "<body>",
//                "code a",
//                "code b",
//                "code c",
//                "code d",
//                "code e",
//
//                "code g",
//                "</body>",
//                "</html>" );
//
//    $f2=Array(  "<html>",
//                "<head><title>Text2</title></head>",
//                "<body>",
//                "code a",
//                "code a",
//
//                "code c",
//                "code d",
//                "code e",
//
//
//                "code g",
//                "code f",
//                "</body>",
//                "</html>" );
//
    #you can use files as input and compare them
    # simply with, this gives you simple diff in your webserver.
    #
    # $f3= file ("path to file");




    print "<hr>Output Differences :<br>";
    // $obj_page->arr_diff( $f1, $f2 );

    $d1    =  $obj_page->arr_diff( $f1, $f2 );
    print $d1;
    $count =  explode('<br>',$d1);
    echo "this is count ".count($count);

    print "<hr>Identlical lines shown:<br>";
    print $obj_page->arr_diff( $f1, $f2 ,1);



    break;


 default:

		include ABSTRACT_PRIVATE_HEADER;
		$page_data = array('action_link'=> '?task=display');
		include"templates/tpl_validate.php";
		include ABSTRACT_PRIVATE_FOOTER;
		break;

}
?>
<script>

  function popwin5(url) {
   win = window.open(url,"","menubar=no,toolbar=no,location=no,scrollbars=yes,resizable=yes,status=no");
   // This probably only works in firefox
   //win.onblur = function() {win.close();}
   // Dan didt like this effect for the reports anyway
}
</script>